﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sok.Munkae.Tenant;

namespace Sok.Munkae.Web.FormsAuthentication
{
    public class HttpContextHostNameProvider : IHostNameProvider
    {
        public string GetHostName()
        {
            string[] hostNameParts = HttpContext.Current.Request.Url.Host.Split(new char[]{'.'});
            string hostName = hostNameParts[0];
            //TODO: Check to make sure there are three parts
            return hostName;
        }
        public string GetDomainName()
        {
            return HttpContext.Current.Request.Url.Host;
        }

    }
}
